package com.seguriapp.configuration;

import org.apache.log4j.Logger;

/**
 * Loads the file with the relations between zoom level and distance.
 */
public class MapRelationsListLoader {

  private static final Logger LOGGER = Logger.getLogger(MapRelationsListLoader.class);

  private MapRelationsList mapRelationsList;

  private static final MapRelationsListLoader INSTANCIA = new MapRelationsListLoader();

  /**
   * @return The only instance of the map relations list loader.
   */
  public static MapRelationsListLoader getInstance() {
    return INSTANCIA;
  }

  public void init(Object o) {
    if (o instanceof MapRelationsList) {
      mapRelationsList = (MapRelationsList) o;
    } else {
      LOGGER.info("Error loading MapRelationsList file");
    }
  }

  /**
   * @return Map relations list
   */
  public MapRelationsList getMapRelationsList() {
    return mapRelationsList;
  }

}
